bitkeeper revision 1.719.1.1 (402b88dbPFLq-2M3bwI8UKm_GsCkQw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Thu, 12 Feb 2004 14:08:27 +0000 (14:08 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Thu, 12 Feb 2004 14:08:27 +0000 (14:08 +0000)
process.c, Rules.mk:
  Fix bug when context-switching LDT in Xenolinux.

xen/arch/i386/Rules.mk
xenolinux-2.4.24-sparse/arch/xeno/kernel/process.c

index 7adf28664d92b694119b6ab805b72eab0cfa10ad..56f5932b6d58f1b74db1c2892c663c21f956a783 100644 (file)
@@ -9,8 +9,8 @@ MONITOR_BASE := 0xFC500000
 LOAD_BASE    := 0x00100000
 CFLAGS  := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing 
 CFLAGS  += -iwithprefix include -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE)
-#CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
-CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
+CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
+#CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
 CFLAGS  += -Wno-pointer-arith -Wredundant-decls
 LDFLAGS := -T xeno.lds -N
 
index 78820a8b15ecb655cbbb5ed93cefd7bc699fd47b..d57c6ba2dc467df7572b2778161a99ca7ef1e437 100644 (file)
@@ -371,6 +371,15 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 
     __cli();
 
+    /*
+     * We clobber FS and GS here so that we avoid a GPF when restoring previous
+     * task's FS/GS values in Xen when the LDT is switched. If we don't do this
+     * then we can end up erroneously re-flushing the page-update queue when
+     * we 'execute_multicall_list'.
+     */
+    __asm__ __volatile__ ( 
+        "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs" : : : "eax" );
+
     MULTICALL_flush_page_update_queue();
 
     /*